package com.sf.proxy.commandline;

import com.sf.proxy.server.ServerStarter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class ProxyServerCommandLineRunner implements CommandLineRunner {
    @Value("${http.proxy.server.port}")
    private int proxyServerPort;

    @Override
    public void run(String... args) throws Exception {
//        HttpProxyServer server = new HttpProxyServer(proxyServerPort);
////        server.start();
        ServerStarter starter = new ServerStarter();
        starter.start(proxyServerPort);
    }
}
